<?php

namespace FoxLib\Contexts;

class LogContext
{
    private $items = [];

    public function setItem($record)
    {
        $item = new \Aliyun_Log_Models_LogItem();
        $item->setContents([
            'level' => $record['level_name'],
            'message' => $record['formatted'],
        ]);
        $item->setTime(time());

        array_push($this->items, $item);
    }

    public function getItems()
    {
        return $this->items;
    }
}